package com.yss.activemq_demo.listener;

import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.stereotype.Component;

import javax.jms.ConnectionFactory;

/**
 * @ClassName activeMq监听
 * @Description TODO
 * @Author lisongfeng
 * @Date 2019/5/14 15:25
 **/
@Component
public class ActiveMqListener {

    @JmsListener(destination = "${activeMq.acs.topicName}", containerFactory = "jmsListenerContainerTopic")
    @SendTo("return-topic")
    public void receiveTopic(String message) {
        System.out.println("监听topic=============yssTask");
        System.out.println(message);
    }

}
